<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link
      rel="stylesheet"
      href="../../lib/bootstrap-3.3.5-dist/css/bootstrap.min.css"
    />
    <script src="../../lib/bootstrap-3.3.5-dist/js/jquery-1.11.3.js"></script>
    <script src="../../lib/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="../../css/wdbm.css" />
  </head>
  <body>
    <div id="warp" class="container-fluid">
      <div id="indexContent" class="row">
        <div
          id="indexNav"
          class="col-lg-offset-1 col-lg-3 col-md-offset-1 col-md-3"
        >
          <span>我的部门列表</span>
          <span>机构1</span>
          <ul></ul>
        </div>
        <div
          id="indexSection"
          class="col-lg-offset-1 col-lg-7 col-md-offset-1 col-md-7"
        ></div>
      </div>
    </div>
  </body>
  <script>
    let pageContent = [{ id: 1, name: "临床门诊部", url: "./bumen.html" }];
    showLi();
    $("#indexSection").load("./bumen.html");
    function showLi() {
      pageContent.forEach((item) => {
        $("#indexNav ul").append(`
        <li> <a data-url="${item.url}">${item.name}</a></li>
        `);
      });
    }
    $("#indexNav ul li a").click(function (e) {
      e.preventDefault();
      let url = $(this).attr("data-url");
      console.log(url);
      $("#indexSection").load(url);
    });
  </script>
</html>
